<template>
	<view class="">
		<!-- <u-navbar :is-back='false' :border-bottom='false' title='商家入口' title-color='#ffffff' :is-fixed='true'
			:background='background'>
			<view class="slot-wrap">
				<view @click="back"
					style="border-radius: 50%;width: 50rpx;height: 50rpx;background-color:rgba(0,0,0,.2);position: relative;">
					<text class="iconfont icon-xiangzuo"
						style="font-size: 40rpx;color: #FFFFFF;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);"></text>
				</view>
		
			</view>
		</u-navbar> -->
		<view
			style="width: 750rpx;height: 366rpx;background: linear-gradient(180deg, #1fb0ac 0%, #F5F5F5 100%);position: relative;">
			<view class="" style="padding-top: 50rpx;padding-bottom: 30rpx;">
				<view style="width: 90%;margin: 0 auto;font-size: 50rpx;color: #FFFFFF;line-height: 80rpx;">
					登录账号
				</view>
				<view style="width: 90%;margin: 0 auto;font-size: 26rpx;color: #FFFFFF;opacity: 0.6;">
					登录享受更多精彩
				</view>
				<view style="width: 100%;background-color: #FFFFFF;border-radius: 20rpx 20rpx 0 0;box-sizing: border-box;padding: 20rpx 30rpx;margin-top: 60rpx;">
					<view style="width: 100rpx;height: 14rpx;background-color: #C0C0C0;margin: 20rpx auto;border-radius: 6rpx;">
						
					</view>
					<view style="line-height: 80rpx;color: #999999;font-size: 24rpx;">
						账号
					</view>
					<view>
						<input v-model="zhanghao" placeholder="请输入账号" type="text"   style="width: 100%;height: 100rpx;line-height: 100rpx;border-radius: 16rpx;background-color: #eeeeee;box-sizing: border-box;padding: 0 30rpx;" />
					</view>
					<view style="line-height: 80rpx;color: #999999;font-size: 24rpx;">
						密码
					</view>
					<view>
						<input v-model="mima" type="password" placeholder="请输入密码"   style="width: 100%;height: 100rpx;line-height: 100rpx;border-radius: 16rpx;background-color: #eeeeee;box-sizing: border-box;padding: 0 30rpx;" />
					</view>
				</view>
				<view @click="deng" style="width: 92%;margin: 40rpx auto;background-color: #1fb0ac;height: 90rpx;line-height: 90rpx;color: #FFFFFF;text-align: center;border-radius: 45rpx;font-size: 30rpx;">
					确认提交
				</view>
				<view style="line-height: 90rpx;color: #999999;font-size: 24rpx;text-align: center;">
					管理员可以直接登录
				</view>
				<view @click="wx_deng" style="text-align: center;">
					<image src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/weixin.png" style="width: 120rpx;height: 120rpx;border-radius: 16rpx;" mode=""></image>
				</view>
				<view style="line-height: 90rpx;color: #999999;font-size: 24rpx;text-align: center;margin-top: 20rpx;">
					未入驻企业请先入驻
				</view>
				<!-- <view @click="ruzhu" style="width: 92%;margin: 0rpx auto;background-color: #DD524D;height: 90rpx;line-height: 90rpx;color: #FFFFFF;text-align: center;border-radius: 45rpx;font-size: 30rpx;">
					我要入驻
				</view>
				<view style="line-height: 90rpx;color: #999999;font-size: 24rpx;text-align: center;margin-top: 20rpx;">
					客服电话：{{work.mobile}}
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				background: {
					background: 'linear-gradient(180deg, #0078FF 0%, #1fb0ac 100%)'
				},
				zhanghao:'',
				mima:'',
				work:{}
			}
		},
		onPullDownRefresh() {
			this.yang()
		       setTimeout(function () {
		           uni.stopPullDownRefresh();
		       }, 1500);
		  },
		onLoad() {
			// this.wo()
			// this.yang()
		},
		methods:{
			// 联系我们
			wo:function(){
				this.post('api/help/contact','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.work=res.data
					}
				})
			},
			// 增加访问量
			yang:function(){
				this.post('api/homepage/pageviews',{path:'/pages/my/rukou'},true).then(res=>{
					console.log(res)
				})
			},
			back:function(){
				uni.navigateBack({
					delta:1
				})
			},
			ruzhu:function(){
				uni.navigateTo({
					url:'./shop'
				})
			},
			deng:function(){
				this.post('api/firm/account_login',{account:this.zhanghao,password:this.mima},true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						uni.setStorageSync('shop_xx',res.data)
						setTimeout(function(){
							uni.navigateTo({
								url:'shopjia'
							})
						},1500)
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
				
			},
			wx_deng:function(){
				this.post('api/firm/login','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
						uni.setStorageSync('shop_xx',res.data)
						setTimeout(function(){
							uni.navigateTo({
								url:'../../subpages/pages/shopjia'
							})
						},1500)
					}else{
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF !important;
		font-family: Demibold;
		// padding-bottom: 30rpx;
	}
	
	.slot-wrap {
		display: flex;
		align-items: center;
		/* 如果您想让slot内容占满整个导航栏的宽度 */
		/* flex: 1; */
		/* 如果您想让slot内容与导航栏左右有空隙 */
		padding: 0 30rpx;
	}
</style>
